﻿using SqlSugar;

namespace MyModels
{
    public class RootEntityTKey<TKey> where TKey : IEquatable<TKey>
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true,ColumnDescription ="主键ID")]

        // [Newtonsoft.Json.JsonConverter(typeof(ValueToStringConverter))]
        public TKey Id { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [SugarColumn(ColumnDescription = "是否删除")]
        public bool? IsDeleted { get; set; } = false;

        /// <summary>
        /// 创建ID
        /// </summary>
        [SugarColumn(IsNullable =true,ColumnDescription = "创建ID")]
        public TKey? CreateId { get; set; }
       
        /// <summary>
        /// 创建者
        /// </summary>
        [SugarColumn(ColumnDescription = "创建者")]
        public string? CreateBy { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间")]
        public DateTime? CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 修改ID
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "修改ID")]
        public TKey? ModifyId { get; set; }

        /// <summary>
        /// 修改者
        /// </summary>
        [SugarColumn(ColumnDescription = "修改者")]
        public string? ModifyBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(ColumnDescription = "修改时间")]
        public DateTime? ModifyTime { get; set; }
    }
}
